<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Subject')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-subject" class="form-control " rows="5" name="row[subject]" cols="50"></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Choice')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-group row">
                <div class="col-xs-12">
                    <table class="table fieldlist" data-template="choicetpl" data-name="row[choice]"
                        id="first-table">
                        <tr>
                            <td>{:__('选项')}</td>
                            <td>{:__('信息')}</td>
                            <td width="100"></td>
                        </tr>
                        <tr>
                            <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i
                                        class="fa fa-plus"></i> {:__('Append')}</a></td>
                        </tr>
                    </table>

                    <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
                    <textarea id="c-choice" class="hidden form-control " rows="5" name="row[choice]" cols="50">[{"ingredients":"","content":""}]</textarea>
                    <script id="choicetpl" type="text/html">
                        <tr class="form-inline">
                            <td><input type="text" name="<%=name%>[<%=index%>][ingredients]" class="form-control" size="15" value="<%=row.ingredients%>" placeholder="选项A,B..."/></td>
                            <td><textarea type="text" style="width: 100%; height: 100px;" name="<%=name%>[<%=index%>][content]" class="form-control" style="width:120px" placeholder="内容"><%=row.content%></textarea></td>
                            <td>
                                <!--下面的两个按钮务必保留-->
                                <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                                <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                            </td>
                        </tr>
                    </script>
                </div>
            </div>
        </div>
    </div>

<!-- 
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-group row">
                <div class="col-xs-12">
                    <table class="table fieldlist" data-template="answertpl" data-name="row[answer]"
                        id="first-table">
                        <tr>
                            <td>{:__('选项')}</td>
                            <td>{:__('信息')}</td>
                            <td width="100"></td>
                        </tr>
                        <tr>
                            <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i
                                        class="fa fa-plus"></i> {:__('Append')}</a></td>
                        </tr>
                    </table>
                    <textarea id="c-answer" class="hidden form-control " rows="5" name="row[answer]" cols="50">[{"ingredients":"","content":""}]</textarea>
                    <script id="answertpl" type="text/html">
                        <tr class="form-inline">
                            <td><input type="text" name="<%=name%>[<%=index%>][ingredients]" class="form-control" size="15" value="<%=row.ingredients%>" placeholder="选项A,B..."/></td>

                            <td><textarea type="text" style="width: 100%; height: 100px;" name="<%=name%>[<%=index%>][content]" class="form-control" style="width:120px" placeholder="内容"><%=row.content%></textarea></td>
                        </tr>
                    </script>
                </div>
            </div>
        </div>
    </div> -->



    
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-answer" class="form-control " rows="5" name="row[answer]" cols="50"></textarea>
        </div>
    </div> -->


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
